]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: use integer coordinates
authorClément Guérin <geecko.dev@free.fr>
Sat, 14 Mar 2015 22:45:11 +0000 (23:45 +0100)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 14 Mar 2015 23:04:23 +0000 (16:04 -0700)
This fixes the shivery selection rectangle when making a region
screenshot.

https://bugzilla.gnome.org/show_bug.cgi?id=746223

js/ui/screenshot.js

index 45f013c8e1845fd65ef8273770e9cd573de271be..50c5f9d07634519e5d54f8b8d0547278ece2c4f8 100644 (file)
@@ -292,6 +292,8 @@ const SelectArea = new Lang.Class({
             return Clutter.EVENT_PROPAGATE;
 
         [this._lastX, this._lastY] = event.get_coords();
+        this._lastX = Math.floor(this._lastX);
+        this._lastY = Math.floor(this._lastY);
         let geometry = this._getGeometry();
 
         this._rubberband.set_position(geometry.x, geometry.y);
@@ -302,6 +304,8 @@ const SelectArea = new Lang.Class({
 
     _onButtonPress: function(actor, event) {
         [this._startX, this._startY] = event.get_coords();
+        this._startX = Math.floor(this._startX);
+        this._startY = Math.floor(this._startY);
         this._rubberband.set_position(this._startX, this._startY);
 
         return Clutter.EVENT_PROPAGATE;